<template>
  <router-view />
</template>

<script>
import { useRoute, useRouter } from 'vue-router';
export default {
  props: {
    userInfo: Object,
    path: {
        type: String,
        default: '/user'
    }
  },
  setup(props) {
    const route = useRoute();
    const router = useRouter();
    const navigateToTodoPage = () => {
      // 使用 router.push() 方法跳转到指定的页面
      router.push({ path: props.path, query: props.userInfo}); // 或者使用 name: 'todo'，取决于您的路由设置
    };
    onMounted(() => {
      navigateToTodoPage()
    });
    return {
      navigateToTodoPage
    };
  }
};
</script>